export type TestType = 'home' | 'dashboard' | 'profile' | 'reaction' | 'typing' | 'memory' | 'attention' | 'coordination' | 'color' | 'math' | 'logical' | 'visual' | 'working-memory' | 'spatial-reasoning' | 'pattern-recognition' | 'abstract-reasoning' | 'critical-thinking' | 'creative-thinking' | 'word-association' | 'audio-memory' | 'sequence-reasoning' | 'emotion-recognition' | 'multitask' | 'reading-comprehension' | 'cognitive-flexibility' | 'inhibitory-control' | 'processing-speed' | 'spatial-memory' | 'verbal-fluency' | 'decision-making' | 'time-perception' | 'digit-memory' | 'concept-formation';

export interface TestResult {
  id: string;
  testType: string;
  score: number;
  maxScore?: number;
  date?: Date;
  completedAt: Date;
  timestamp?: Date;
  duration: number;
  percentile?: number;
  difficulty?: string;
  details?: {
    // AI对战模式
    battleMode?: boolean;
    opponent?: string;
    winner?: 'player' | 'ai';
    rounds?: number;
    playerHealth?: number;
    aiHealth?: number;
    
    // 反应时间测试
    averageReactionTime?: number;
    reactionTimes?: number[];
    bestTime?: number;
    worstTime?: number;
    consistency?: number;
    rating?: string;
    
    // 记忆测试
    averageTime?: number;
    itemsRemembered?: number;
    totalItems?: number;
    
    // 通用字段
    totalQuestions?: number;
    correctAnswers?: number;
    accuracy?: number;
    averageTimePerQuestion?: number;
    totalRounds?: number;
    
    [key: string]: any;
  };
}

export interface UserProfile {
  name: string;
  age?: number;
  level: number;
  totalTests: number;
  averageScore: number;
  badges: string[];
  streak: number;
  joinDate: Date;
}

export interface Achievement {
  id: string;
  name: string;
  description: string;
  icon: any;
  unlocked: boolean;
  unlockedDate?: Date;
  category: 'milestone' | 'performance' | 'mastery' | 'speed' | 'persistence' | 'comprehensive' | 'challenge' | 'specific' | 'hidden' | 'ai-battle';
  rarity: 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
}

export interface TestConfig {
  id: TestType;
  title: string;
  description: string;
  icon: any;
  color: string;
  bgColor: string;
  difficulty: string;
  duration: string;
  category: string;
}

export interface TestCategory {
  name: string;
  description: string;
  color: string;
  tests: string[];
}